#include "Bullet3Common/b3TransformUtil.h"
#ifdef __cplusplus
extern "C" {
#endif
b3TransformUtil* bullet_Newb3TransformUtil(){
	b3TransformUtil* wrap_out = new b3TransformUtil();
	return wrap_out;
}

void bullet_b3TransformUtil_calculateDiffAxisAngle(b3TransformUtil* c_this,b3Transform* transform0,b3Transform* transform1,b3Vector3* axis,float* angle){
	b3Transform const& c_arg_transform0=(b3Transform const&)(*transform0);
	b3Transform const& c_arg_transform1=(b3Transform const&)(*transform1);
	b3Vector3& c_arg_axis=(b3Vector3&)(*axis);
	b3Scalar& c_arg_angle=(b3Scalar&)(*angle);
	c_this->calculateDiffAxisAngle(c_arg_transform0,c_arg_transform1,c_arg_axis,c_arg_angle);
}

void bullet_b3TransformUtil_calculateDiffAxisAngleQuaternion(b3TransformUtil* c_this,b3Quaternion* orn0,b3Quaternion* orn1a,b3Vector3* axis,float* angle){
	b3Quaternion const& c_arg_orn0=(b3Quaternion const&)(*orn0);
	b3Quaternion const& c_arg_orn1a=(b3Quaternion const&)(*orn1a);
	b3Vector3& c_arg_axis=(b3Vector3&)(*axis);
	b3Scalar& c_arg_angle=(b3Scalar&)(*angle);
	c_this->calculateDiffAxisAngleQuaternion(c_arg_orn0,c_arg_orn1a,c_arg_axis,c_arg_angle);
}

void bullet_b3TransformUtil_calculateVelocity(b3TransformUtil* c_this,b3Transform* transform0,b3Transform* transform1,float timeStep,b3Vector3* linVel,b3Vector3* angVel){
	b3Transform const& c_arg_transform0=(b3Transform const&)(*transform0);
	b3Transform const& c_arg_transform1=(b3Transform const&)(*transform1);
	b3Scalar c_arg_timeStep=timeStep;
	b3Vector3& c_arg_linVel=(b3Vector3&)(*linVel);
	b3Vector3& c_arg_angVel=(b3Vector3&)(*angVel);
	c_this->calculateVelocity(c_arg_transform0,c_arg_transform1,c_arg_timeStep,c_arg_linVel,c_arg_angVel);
}

void bullet_b3TransformUtil_calculateVelocityQuaternion(b3TransformUtil* c_this,b3Vector3* pos0,b3Vector3* pos1,b3Quaternion* orn0,b3Quaternion* orn1,float timeStep,b3Vector3* linVel,b3Vector3* angVel){
	b3Vector3 const& c_arg_pos0=(b3Vector3 const&)(*pos0);
	b3Vector3 const& c_arg_pos1=(b3Vector3 const&)(*pos1);
	b3Quaternion const& c_arg_orn0=(b3Quaternion const&)(*orn0);
	b3Quaternion const& c_arg_orn1=(b3Quaternion const&)(*orn1);
	b3Scalar c_arg_timeStep=timeStep;
	b3Vector3& c_arg_linVel=(b3Vector3&)(*linVel);
	b3Vector3& c_arg_angVel=(b3Vector3&)(*angVel);
	c_this->calculateVelocityQuaternion(c_arg_pos0,c_arg_pos1,c_arg_orn0,c_arg_orn1,c_arg_timeStep,c_arg_linVel,c_arg_angVel);
}

void bullet_b3TransformUtil_integrateTransform(b3TransformUtil* c_this,b3Transform* curTrans,b3Vector3* linvel,b3Vector3* angvel,float timeStep,b3Transform* predictedTransform){
	b3Transform const& c_arg_curTrans=(b3Transform const&)(*curTrans);
	b3Vector3 const& c_arg_linvel=(b3Vector3 const&)(*linvel);
	b3Vector3 const& c_arg_angvel=(b3Vector3 const&)(*angvel);
	b3Scalar c_arg_timeStep=timeStep;
	b3Transform& c_arg_predictedTransform=(b3Transform&)(*predictedTransform);
	c_this->integrateTransform(c_arg_curTrans,c_arg_linvel,c_arg_angvel,c_arg_timeStep,c_arg_predictedTransform);
}

b3ConvexSeparatingDistanceUtil* bullet_Newb3ConvexSeparatingDistanceUtil(float boundingRadiusA,float boundingRadiusB){
	b3Scalar c_arg_boundingRadiusA=boundingRadiusA;
	b3Scalar c_arg_boundingRadiusB=boundingRadiusB;
	b3ConvexSeparatingDistanceUtil* wrap_out = new b3ConvexSeparatingDistanceUtil(c_arg_boundingRadiusA,c_arg_boundingRadiusB);
	return wrap_out;
}

float bullet_b3ConvexSeparatingDistanceUtil_getConservativeSeparatingDistance(b3ConvexSeparatingDistanceUtil* c_this){
	b3Scalar c_out = c_this->getConservativeSeparatingDistance();
	float wrap_out = (c_out);
	return wrap_out;
}

void bullet_b3ConvexSeparatingDistanceUtil_initSeparatingDistance(b3ConvexSeparatingDistanceUtil* c_this,b3Vector3* separatingVector,float separatingDistance,b3Transform* transA,b3Transform* transB){
	b3Vector3 const& c_arg_separatingVector=(b3Vector3 const&)(*separatingVector);
	b3Scalar c_arg_separatingDistance=separatingDistance;
	b3Transform const& c_arg_transA=(b3Transform const&)(*transA);
	b3Transform const& c_arg_transB=(b3Transform const&)(*transB);
	c_this->initSeparatingDistance(c_arg_separatingVector,c_arg_separatingDistance,c_arg_transA,c_arg_transB);
}

void bullet_b3ConvexSeparatingDistanceUtil_updateSeparatingDistance(b3ConvexSeparatingDistanceUtil* c_this,b3Transform* transA,b3Transform* transB){
	b3Transform const& c_arg_transA=(b3Transform const&)(*transA);
	b3Transform const& c_arg_transB=(b3Transform const&)(*transB);
	c_this->updateSeparatingDistance(c_arg_transA,c_arg_transB);
}

#ifdef __cplusplus
}
#endif
